class Person {
    public String name;
    public int age;

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    @Override
    public boolean equals(Object obj) {
        Person person = (Person) obj;
        if (this.name.equals(person.name)) {
            return true;
        }
        return false;
    }


}
public class Test {
    public static void main(String[] args) {
        Person person1 = new Person("zhagnsan", 1);
        Person person2 = new Person("zhagnsan", 1);
        System.out.println(person1.equals(person2));
        System.out.println(person1 == person2);
    }
}

